package com.tjsinfo.tjsoa.vote.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.tjsinfo.tjsoa.vote.bo.ITVoteColumnBO;

public class ColumnDelAction extends Action {
	private ITVoteColumnBO columnBo;
	public void setColumnBo(ITVoteColumnBO columnBo) {
		this.columnBo = columnBo;
	}
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		try {
			String columnId = request.getParameter("columnId");
			String headId = request.getParameter("headId");
			String status = request.getParameter("status");
			String conformationId = request.getParameter("conformationId");
			
			columnBo.delete(columnId);
			
			request.setAttribute("linkurl", "tjsinfo/tjsoa/vote/columnList.do?headId="+headId+"@status="+status+"@conformationId="+conformationId+"");
			request.setAttribute("message", "vote.columnDel.message");			
			
			return mapping.findForward("success");
		} catch (Exception e) {
			e.printStackTrace();
			return mapping.findForward("failed");
		}
	}
}
